package o;

import com.huawei.appgallery.foundation.card.base.normal.bean.NormalCardBean;
import com.huawei.appgallery.foundation.store.bean.detail.DetailResponse;
import com.huawei.appgallery.foundation.ui.css.CSSRule;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.LayoutData;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.bean.BaseHorizontalModuleCardBean;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

public class clp<T extends NormalCardBean> {
    private String ʻ;
    private int ʼ = 1;
    private String ʽ;
    private CSSRule ˊ;
    private List<T> ˋ = new ArrayList();
    private String ˋॱ;
    private List<T> ˎ = new ArrayList();
    private boolean ˏ = true;
    private String ˏॱ;
    private int ॱ = 2;
    private int ॱॱ;
    private long ᐝ;

    public void ˏ(DetailResponse<CardBean> detailResponse) {
        int i = 0;
        if (detailResponse != null) {
            if (detailResponse.ॱ() == 0) {
                ॱ(false);
            } else {
                ॱ(true);
            }
            List ᐝॱ = detailResponse.ᐝॱ();
            if (!CollectCheck.isEmpty(ᐝॱ)) {
                LayoutData layoutData = (LayoutData) ᐝॱ.get(0);
                if (layoutData != null && !CollectCheck.isEmpty(layoutData.ˋ()) && (layoutData.ˋ().get(0) instanceof BaseHorizontalModuleCardBean)) {
                    BaseHorizontalModuleCardBean baseHorizontalModuleCardBean = (BaseHorizontalModuleCardBean) layoutData.ˋ().get(0);
                    if (!CollectCheck.isEmpty(baseHorizontalModuleCardBean.ʻˋ())) {
                        cif ॱꜞ;
                        this.ॱ++;
                        if (this.ˋ.isEmpty()) {
                            ॱꜞ = baseHorizontalModuleCardBean.ॱꜞ();
                        } else {
                            ॱꜞ = ((NormalCardBean) this.ˋ.get(0)).ॱꜞ();
                        }
                        while (i < baseHorizontalModuleCardBean.ʻˋ().size()) {
                            NormalCardBean normalCardBean = (NormalCardBean) baseHorizontalModuleCardBean.ʻˋ().get(i);
                            if (!(this.ˋ.contains(normalCardBean) || this.ˎ.contains(normalCardBean))) {
                                normalCardBean.ˊ(ॱꜞ);
                                this.ˎ.add(normalCardBean);
                            }
                            i++;
                        }
                        baseHorizontalModuleCardBean.ʼˋ();
                        ˋ(layoutData);
                        if (!CollectCheck.isEmpty(this.ˎ)) {
                            this.ˋ.addAll(this.ˎ);
                            this.ˎ.clear();
                        }
                    }
                }
            }
        }
    }

    private void ˋ(LayoutData<CardBean> layoutData) {
        int i = 0;
        if (layoutData.ˊ() == 1) {
            i = 1;
        }
        if (layoutData.ॱ() == 1) {
            i |= 2;
        }
        ˏ(i);
    }

    private void ˏ(int i) {
        if (!CollectCheck.isEmpty(this.ˎ)) {
            ListIterator listIterator = this.ˎ.listIterator(0);
            while (listIterator.hasNext() && this.ˎ.size() > 1) {
                if (((NormalCardBean) listIterator.next()).ˋ(i)) {
                    listIterator.remove();
                }
            }
        }
    }

    public CSSRule ˏ() {
        return this.ˊ;
    }

    public void ˋ(CSSRule cSSRule) {
        this.ˊ = cSSRule;
    }

    public String ˋ() {
        return this.ʽ;
    }

    public void ˋ(String str) {
        this.ʽ = str;
    }

    public long ˎ() {
        return this.ᐝ;
    }

    public void ॱ(long j) {
        this.ᐝ = j;
    }

    public int ˊ() {
        return this.ॱ;
    }

    public void ॱ(int i) {
        this.ॱ = i;
    }

    public List<T> ॱ() {
        return this.ˋ;
    }

    public void ˎ(List<T> list) {
        this.ˋ = list;
    }

    public boolean ॱॱ() {
        return this.ˏ;
    }

    public void ॱ(boolean z) {
        this.ˏ = z;
    }

    public int ʻ() {
        return this.ॱॱ;
    }

    public void ˎ(int i) {
        this.ॱॱ = i;
    }

    public int ᐝ() {
        return this.ʼ;
    }

    public void ˊ(int i) {
        this.ʼ = i;
    }

    public void ˏ(String str) {
        this.ʻ = str;
    }

    public String ʽ() {
        return this.ˋॱ;
    }

    public void ॱ(String str) {
        this.ˋॱ = str;
    }

    public String ʼ() {
        return this.ˏॱ;
    }

    public void ˊ(String str) {
        this.ˏॱ = str;
    }
}
